<template>
  <div class="bind">
    <basic-container>
      <avue-tabs :option="option" @change="handleChange"></avue-tabs>
      <Role v-if="type.prop === 'role'"></Role>
      <User v-else-if="type.prop === 'user'"></User>
      <School v-else-if="type.prop === 'school'"></School>
    </basic-container>
  </div>
</template>

<script>
import Role from "./bind/role.vue";
import User from "./bind/user.vue";
import School from "./bind/school.vue";

export default {
  name: "Bind",
  components: { Role, User, School },
  data() {
    return {
      type: {},
      option: {
        column: [
          {
            icon: "el-icon-info",
            label: "角色绑定",
            prop: "role"
          },
          {
            icon: "el-icon-warning",
            label: "适用人群绑定",
            prop: "user"
          },
          {
            icon: "el-icon-question",
            label: "学校绑定",
            prop: "school"
          }
        ]
      }
    };
  },
  created() {
    this.type = this.option.column[0];
  },
  methods: {
    handleChange(column) {
      this.type = column;
    }
  }
};
</script>

<style lang="scss" scoped>
.bind {
}
</style>
